﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ActivosPrincipal.aspx.cs" Inherits="AudiPyme.UI.ActivosPrincipal"
    EnableEventValidation="false" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="PanelAdministrador" runat="server">
        <ul class="list1" id="ListaOpciones" runat="server">
        </ul>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <div id='basic-modal' style="text-align: right">
        <a href='#' class='basic'>
            <img src="/Images/Icono_ayuda.jpg" alt="Pinche para ver un video tutorial de la página"
                width="30 " height="30" border="0"></a>
    </div>
    <!-- modal content -->
    <div id="basic-modal-content">
        <iframe width="853" height="480" src="http://www.youtube.com/embed/5KEZ7QYPecU" frameborder="0"
            allowfullscreen></iframe>
    </div>
    <!-- preload the images -->
    <div style='display: none'>
        <img src='Images/x.png' alt='' />
    </div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <h2>
                Activos Principal</h2>
            <asp:Panel ID="PanelOpcClasif" runat="server" Visible="False">
                <h4>
                    Distribución de Activos de la Empresa por
                    <asp:Label ID="LblOpcion" runat="server" Text="Tipo de Activo"></asp:Label>
                    &nbsp;<asp:Label ID="LblTipoActivo" runat="server"></asp:Label>
                </h4>
                <h5>
                    Criterio de Clasificación</h5>
                <p>
                    <asp:DropDownList ID="DdlActivos" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DdlActivos_SelectedIndexChanged"
                        Width="150px">
                        <asp:ListItem Value="TipoActivo">Tipo de Activo</asp:ListItem>
                        <asp:ListItem Value="ValorActivo">Valor del Activo</asp:ListItem>
                        <asp:ListItem Value="CosteActivo">Coste del Activo</asp:ListItem>
                    </asp:DropDownList>
                &nbsp;
            </asp:Panel>
            <asp:Panel ID="PnlRangos" runat="server" Height="76px" Width="550px" Visible="False">
                <h5>
                    Seleccione los rangos para clasificar a los activos por su valor</h5>
                <asp:Label ID="LblRng1" runat="server" Text="Rango1:"></asp:Label>
                <asp:DropDownList ID="DdlRng1" runat="server" Width="100px">
                    <asp:ListItem Selected="True" Value="0">-------------------</asp:ListItem>
                    <asp:ListItem Value="1000">&lt; 1.000€</asp:ListItem>
                    <asp:ListItem Value="2000">&lt; 2.000 €</asp:ListItem>
                    <asp:ListItem Value="5000">&lt; 5.000€</asp:ListItem>
                    <asp:ListItem Value="10000">&lt; 10.000€</asp:ListItem>
                    <asp:ListItem Value="20000">&lt; 20.000€</asp:ListItem>
                    <asp:ListItem Value="50000">&lt; 50.000€</asp:ListItem>
                    <asp:ListItem Value="100000">&lt; 100.000€</asp:ListItem>
                    <asp:ListItem Value="500000">&lt; 500.000€</asp:ListItem>
                    <asp:ListItem Value="1000000">&lt; 1.000.000</asp:ListItem>
                    <asp:ListItem Value="1000001">&gt; 1.000.000€</asp:ListItem>
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="RFVRng1" runat="server" ControlToValidate="DdlRng1"
                    ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="ValidadorDdl"></asp:RequiredFieldValidator>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="LblRng2" runat="server" Text="Rango2:"></asp:Label>
                <asp:DropDownList ID="DdlRng2" runat="server" Width="100px">
                    <asp:ListItem Selected="True" Value="0">-------------------</asp:ListItem>
                    <asp:ListItem Value="1000">&lt; 1.000€</asp:ListItem>
                    <asp:ListItem Value="2000">&lt; 2.000 €</asp:ListItem>
                    <asp:ListItem Value="5000">&lt; 5.000€</asp:ListItem>
                    <asp:ListItem Value="10000">&lt; 10.000€</asp:ListItem>
                    <asp:ListItem Value="20000">&lt; 20.000€</asp:ListItem>
                    <asp:ListItem Value="50000">&lt; 50.000€</asp:ListItem>
                    <asp:ListItem Value="100000">&lt; 100.000€</asp:ListItem>
                    <asp:ListItem Value="500000">&lt; 500.000€</asp:ListItem>
                    <asp:ListItem Value="1000000">&lt; 1.000.000</asp:ListItem>
                    <asp:ListItem Value="1000001">&gt; 1.000.000€</asp:ListItem>
                </asp:DropDownList>
                &nbsp;<asp:RequiredFieldValidator ID="RFVRng2" runat="server" ControlToValidate="DdlRng2"
                    ErrorMessage="*" ForeColor="Red" InitialValue="0" ValidationGroup="ValidadorDdl"></asp:RequiredFieldValidator>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Label ID="LblRng3" runat="server" Text="Rango3:"></asp:Label>
                <asp:DropDownList ID="DdlRng3" runat="server" Width="100px">
                    <asp:ListItem Selected="True" Value="0">-------------------</asp:ListItem>
                    <asp:ListItem Value="1000">&lt; 1.000€</asp:ListItem>
                    <asp:ListItem Value="2000">&lt; 2.000 €</asp:ListItem>
                    <asp:ListItem Value="5000">&lt; 5.000€</asp:ListItem>
                    <asp:ListItem Value="10000">&lt; 10.000€</asp:ListItem>
                    <asp:ListItem Value="20000">&lt; 20.000€</asp:ListItem>
                    <asp:ListItem Value="50000">&lt; 50.000€</asp:ListItem>
                    <asp:ListItem Value="100000">&lt; 100.000€</asp:ListItem>
                    <asp:ListItem Value="500000">&lt; 500.000€</asp:ListItem>
                    <asp:ListItem Value="1000000">&lt; 1.000.000</asp:ListItem>
                    <asp:ListItem Value="1000001">&gt; 1.000.000€</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="LblRng4" runat="server"
                    Text="Rango4:"></asp:Label>
                <asp:DropDownList ID="DdlRng4" runat="server" Width="100px">
                    <asp:ListItem Selected="True" Value="0">-------------------</asp:ListItem>
                    <asp:ListItem Value="1000">&lt; 1.000€</asp:ListItem>
                    <asp:ListItem Value="2000">&lt; 2.000 €</asp:ListItem>
                    <asp:ListItem Value="5000">&lt; 5.000€</asp:ListItem>
                    <asp:ListItem Value="10000">&lt; 10.000€</asp:ListItem>
                    <asp:ListItem Value="20000">&lt; 20.000€</asp:ListItem>
                    <asp:ListItem Value="50000">&lt; 50.000€</asp:ListItem>
                    <asp:ListItem Value="100000">&lt; 100.000€</asp:ListItem>
                    <asp:ListItem Value="500000">&lt; 500.000€</asp:ListItem>
                    <asp:ListItem Value="1000000">&lt; 1.000.000</asp:ListItem>
                    <asp:ListItem Value="1000001">&gt; 1.000.000€</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:Label ID="LblRng5" runat="server" Text="Rango5:"></asp:Label>
                &nbsp;<asp:DropDownList ID="DdlRng5" runat="server" Width="100px">
                    <asp:ListItem Selected="True" Value="0">-------------------</asp:ListItem>
                    <asp:ListItem Value="1000">&lt; 1.000€</asp:ListItem>
                    <asp:ListItem Value="2000">&lt; 2.000 €</asp:ListItem>
                    <asp:ListItem Value="5000">&lt; 5.000€</asp:ListItem>
                    <asp:ListItem Value="10000">&lt; 10.000€</asp:ListItem>
                    <asp:ListItem Value="20000">&lt; 20.000€</asp:ListItem>
                    <asp:ListItem Value="50000">&lt; 50.000€</asp:ListItem>
                    <asp:ListItem Value="100000">&lt; 100.000€</asp:ListItem>
                    <asp:ListItem Value="500000">&lt; 500.000€</asp:ListItem>
                    <asp:ListItem Value="1000000">&lt; 1.000.000</asp:ListItem>
                    <asp:ListItem Value="1000001">&gt; 1.000.000€</asp:ListItem>
                </asp:DropDownList>
                &nbsp;&nbsp;&nbsp;<asp:CustomValidator ID="ValidadorRng" runat="server" ErrorMessage="*"
                    ForeColor="Red" OnServerValidate="ValidadorRng_ServerValidate"></asp:CustomValidator>
                <asp:Button ID="BtnAplicar" runat="server" Text="Aplicar" OnClick="BtnAplicar_Click"
                    Width="80px" />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <table>
        <tr>
            <td align="left">
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel ID="PanelChart" runat="server" Visible="False">
                            <asp:Chart ID="Chart1" runat="server" Height="400px" OnClick="Chart1_Click" Palette="None"
                                PaletteCustomColors="DeepSkyBlue; SteelBlue; DodgerBlue; Blue; 0, 192, 192; Teal"
                                Width="380px">
                                <Series>
                                    <asp:Series ChartArea="ChartArea1" Name="Series1" PostBackValue="#VALX" CustomProperties="DrawingStyle=Cylinder" />
                                </Series>
                                <ChartAreas>
                                    <asp:ChartArea Area3DStyle-Enable3D="True" Area3DStyle-IsRightAngleAxes="False" Area3DStyle-LightStyle="Realistic"
                                        Name="ChartArea1" BackColor="Transparent" BackSecondaryColor="Transparent" ShadowColor="White">
                                        <AxisY Interval="5" LabelAutoFitMinFontSize="6" LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisY>
                                        <AxisX Interval="1" LabelAutoFitMinFontSize="9" TextOrientation="Rotated90" LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisX>
                                        <AxisX2 LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisX2>
                                        <AxisY2 LineColor="Gainsboro">
                                            <MajorGrid LineColor="Gainsboro" />
                                        </AxisY2>
                                        <Area3DStyle Enable3D="True" LightStyle="Realistic" Inclination="20" PointGapDepth="0" />
                                    </asp:ChartArea>
                                </ChartAreas>
                            </asp:Chart>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            <td align="left" valign="top">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:Panel ID="PanelGV" runat="server">
                            <asp:GridView ID="GVActivosEmpresa" runat="server" AutoGenerateColumns="false" OnRowCancelingEdit="GVActivosEmpresa_RowCancelingEdit"
                                OnRowEditing="GVActivosEmpresa_RowEditing" OnRowUpdating="GVActivosEmpresa_RowUpdating"
                                AllowPaging="True" OnPageIndexChanging="GVActivosEmpresa_PageIndexChanging" CssClass="myDatagrid"
                                Width="353px">
                                <Columns>
                                    <asp:BoundField DataField="IdActivo" HeaderText="Id" ReadOnly="true" ItemStyle-HorizontalAlign="Center" />
                                    <asp:TemplateField HeaderText="Nombre">
                                        <ItemTemplate>
                                            <%# Eval("Nombre")%>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TxtNombre" runat="server" Text='<%# Eval("Nombre")%>' Width="105px" />
                                            <asp:RequiredFieldValidator ID="RFVTxtNombre" runat="server" ErrorMessage="*" ControlToValidate="TxtNombre"
                                                Display="Dynamic" ValidationGroup="Validador"></asp:RequiredFieldValidator>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Coste" ItemStyle-HorizontalAlign="Right">
                                        <ItemTemplate>
                                            <%# Eval("CosteActivo")%>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TxtCoste" runat="server" MaxLength="9" Text='<%# Eval("CosteActivo")%>'
                                                Width="65px" />
                                            <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="TxtCoste"
                                                ErrorMessage="*" Display="Dynamic" MaximumValue="9999999999" MinimumValue="1"
                                                ValidationGroup="Validador"></asp:RangeValidator>
                                            <asp:RequiredFieldValidator ID="RFVTxtCoste" runat="server" ErrorMessage="*" ControlToValidate="TxtCoste"
                                                Display="Dynamic" ValidationGroup="Validador"></asp:RequiredFieldValidator>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="Valor" ItemStyle-HorizontalAlign="Center">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="DdlValor" runat="server" Width="55px">
                                                <asp:ListItem Selected="True" Value="0">-------</asp:ListItem>
                                                <asp:ListItem Value="1">Bajo</asp:ListItem>
                                                <asp:ListItem Value="2">Medio</asp:ListItem>
                                                <asp:ListItem Value="3">Alto</asp:ListItem>
                                            </asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <%# Eval("ValorEstrategico")%>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    <asp:CommandField ButtonType="Button" CausesValidation="True" ShowCancelButton="true"
                                        HeaderText="Editar" ShowEditButton="true" ItemStyle-HorizontalAlign="Center" />
                                </Columns>
                            </asp:GridView>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
</asp:Content>
